import javax.swing.*;
import java.awt.event.*;
public class JDialogFrame  extends JFrame implements ActionListener{
	
	JPanel jp1;
	JTextField jtf;
	JButton jb1;
	public  JDialogFrame() {
		jp1 = new JPanel();
		JLabel jl1 = new JLabel("enter user name");
		jtf = new JTextField(8);
		jb1 = new JButton("YES");
		jb1.addActionListener(this);
		jp1.add(jl1);
		jp1.add(jtf);
		jp1.add(jb1);
		
		this.add(jp1);
		this.setTitle("JFrame");
		this.setSize(380,180);
		this.setLocationRelativeTo(null);
		this.setDefaultCloseOperation(EXIT_ON_CLOSE);
		
	}
	public static void main(String[] args) {
		
		new JDialogFrame().setVisible(true);
	}
	@Override
	public void actionPerformed(ActionEvent e) {
		// TODO Auto-generated method stub
		
	}

}
